package com.ldu.exam.model;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.UpdateTimestamp;

import com.fasterxml.jackson.annotation.JsonView;
import com.ldu.view.View.Mini;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
@Entity
@Table(name="t_resource")
public class ResourceModel
{
	@Id
	@Column(length=32)
	@GeneratedValue(strategy = GenerationType.IDENTITY,generator = "jpa-uuid")
	@GenericGenerator(name = "jpa-uuid",strategy = "uuid.hex")
	@JsonView(Mini.class)
	private String id ;
	
	/**
	 * 名称
	 */
	@JsonView(Mini.class)
	@Column(length=111,nullable=false,unique=true)
	private String name ;
	
	/**
	 * 简介
	 */
	private String summary ;
	
	/**
	 * 请求方法
	 */
	@JsonView(Mini.class)
	private String method ;
	
	/**
	 * 请求路径
	 */
	@JsonView(Mini.class)
	private String url ;
	
	/**
	 * 创建时间
	 */
	@CreationTimestamp
	private Timestamp creationDate ;
	
	/**
	 * 修改时间
	 */
	@UpdateTimestamp
	private Timestamp updateDate ;
	
}
